<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }
      .date-container {
        width: 200px;
        min-height: 300px;
        margin: 50px auto;
        background-color: greenyellow;
        text-align: center;
      }
      #p {
        height: 50px;
        line-height: 50px;
        background-color: peru;
      }
      #week {
        width: 100px;
        height: 100px;
        background-color: bisque;
        line-height: 100px;
        margin: 0 auto;
        margin-top: 50px;
      }
    </style>
  </head>
  <body>
    <div class="date-container">
      <p id="p">2025年6月16号</p>
      <h1 id="week">星期一</h1>
    </div>
    <script>
      var day = document.getElementById("p");
      var week = document.getElementById("week");

      var d = new Date();

      var Day = d.getDate();
      var Month = d.getMonth();
      var Year = d.getFullYear();
      var Week = d.getDay();

      var W = [
        "星期日",
        "星期一",
        "星期二",
        "星期三",
        "星期四",
        "星期五",
        "星期六",
      ];

      day.innerHTML = `${Year}年${Month}月${Day}日`;
      week.innerHTML = W[Week];
    </script>
  </body>
</html>
